home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / softwareupdate / system / amigados / filefunctions / example4.c < prev    next >
C/C++ Source or Header  |  1996-10-10  |  3KB  |  77 lines

  1. /***********************************************************/
  2. /*                                                         */
  3. /* Amiga C Encyclopedia (ACE)           Amiga C Club (ACC) */
  4. /* --------------------------           ------------------ */
  5. /*                                                         */
  6. /* Manual:  AmigaDOS                    Amiga C Club       */
  7. /* Chapter: File Functions              Tulevagen 22       */
  8. /* File:    Example4.c                  181 41  LIDINGO    */
  9. /* Author:  Anders Bjerin               SWEDEN             */
  10. /* Date:    93-03-15                                       */
  11. /* Version: 1.0                                            */
  12. /*                                                         */
  13. /*   Copyright 1993, Anders Bjerin - Amiga C Club (ACC)    */
  14. /*                                                         */
  15. /* Registered members may use this program freely in their */
  16. /*     own commercial/noncommercial programs/articles.     */
  17. /*                                                         */
  18. /***********************************************************/
  19.  
  20. /* This example demonstrates how to attach a comment to a file.  */
  21. /* The commend will be attached to a file on the Ram disk called */
  22. /* "HighScore.dat". (Please run Example 1 in the "Files" chapter */
  23. /* to create this file before you run this example.) Too see the */
  24. /* comment you can use the Shell (CLI) command "List". Simply    */
  25. /* open a Shell window and type "List Ram:" (without quotations) */
  26.  
  27.  
  28.  
  29. /* Include the dos library definitions: */
  30. #include <dos/dos.h>
  31.  
  32. /* Now we include the necessary function prototype files:         */
  33. #include <clib/dos_protos.h>       /* General dos functions...    */
  34. #include <stdio.h>                 /* Std functions [printf()...] */
  35. #include <stdlib.h>                /* Std functions [exit()...]   */
  36.  
  37.  
  38.  
  39. /* Set name and version number: */
  40. UBYTE *version = "$VER: AmigaDOS/FileFunctions/Example4 1.0";
  41.  
  42.  
  43.  
  44. /* Declared our own function(s): */
  45.  
  46. /* Our main function: */
  47. int main( int argc, char *argv[] );
  48.  
  49.  
  50.  
  51. /* Main function: */
  52.  
  53. int main( int argc, char *argv[] )
  54. {
  55.   /* A simple boolean variable: */
  56.   BOOL ok;
  57.  
  58.  
  59.  
  60.   /* Attach a short comment to the file: */
  61.   ok = SetComment( "RAM:HighScore.dat", "My high-score list!" );
  62.  
  63.   /* Check if the comment was successfully attached: */
  64.   if( ok )
  65.     printf( "The comment was successfull attached to the file!\n" );
  66.   else
  67.     printf( "Could not attach the comment!\n" );
  68.  
  69.  
  70.  
  71.   /* The End! */
  72.   exit( 0 );
  73. }
  74.  
  75.  
  76.  
  77.